import fetch from "@/utils/request";
const BASE_URL = "/bl-article";

export const getArticleList = async (data) => {
  const res = await fetch({
    method: "post",
    url: BASE_URL + "/queryAll",
    data,
  });
  return res;
};

export const getArticleInfoById = (id) => {
  return fetch({
    method: "get",
    url: BASE_URL + `/getArticleInfo?id=${id}`,
  });
};

export const addArticle = async (data) => {
  const res = await fetch({
    method: "post",
    url: BASE_URL + "/add",
    data,
  });
  return res;
};

export const modifyArticle = async (data) => {
  const res = await fetch({
    method: "post",
    data,
    url: BASE_URL + "/modify",
  });
  return res;
};

export const deleteArticle = (id) => {
  return fetch({
    method: "delete",
    url: BASE_URL + `/delete?id=${id}`,
  });
};

export const deleteArticles = (data) => {
  return fetch({
    method: "post",
    url: BASE_URL + "/deleteIds",
    data,
  });
};


export const addClawUrl = (data) =>{
  return fetch({
    method:"post",
    url:BASE_URL + "/claw",
    data,
  })
}
